# 声明要求的 CMake 最低版本
cmake_minimum_required(VERSION 3.10)

# 声明一个 CMake 工程
project(EDevice_PROJECT)

# 设置编译模式
set(CMAKE_BUILD_TYPE "Debug")
# set(CMAKE_BUILD_TYPE "Release")

# 设置编译选项
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-O2")

# 包含当前工作目录下的 include 文件夹
include_directories(${PROJECT_SOURCE_DIR}/inc)

# 动态库源文件
set(LIBRARY_SOURCES
    src/DeviceLibrary.cpp
)

# 生成动态库
add_library(DeviceLibrary SHARED ${LIBRARY_SOURCES})

# 可执行程序源文件
set(EXECUTABLE_SOURCES
    src/main.cpp
)

# 生成可执行程序
add_executable(Test_Equipment_Mon ${EXECUTABLE_SOURCES})

# 链接动态库到可执行程序
target_link_libraries(Test_Equipment_Mon DeviceLibrary )